'use strict';

angular.module('snPaas_om')
	.controller('NavCtrl',['$scope','baseUrl','adminStore',function($scope,baseUrl,adminStore){
		var vm = $scope;
		vm.baseUrl = baseUrl.static;
		vm.username = '';
		var init = function(){
			adminStore.getAdmin().then(function(data){
				vm.username = data.username;
			});
		};
		init();
		vm.logout = function(){
			adminStore.logout().then(function(){
				window.location.href = '/login.html';
			});
		};
		return vm;
	
	}]);